﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;


namespace EZCRS.HCMS.Entity
{
    public class HCRS_Season
    {
        private int _id;
        private int _pid;


        private string _name;

        private string _desc;
        private string _week;

        private DateTime _startdate;
        private DateTime _enddate;

        public HCRS_Season() { }

        public HCRS_Season(DataRow dr)
        {

            if (dr != null)
            {
                if (dr["id"].ToString() != "") _id = Convert.ToInt32(dr["id"].ToString());

                if (dr["Property_id"].ToString() != "") _pid = Convert.ToInt32(dr["Property_id"].ToString());

                _name = dr["name"].ToString();
                _desc = dr["description"].ToString();
                _week = dr["week"].ToString();

                if (dr["startdate"].ToString() != "")
                    _startdate = Convert.ToDateTime(dr["startdate"].ToString());

                if (dr["enddate"].ToString() != "")
                    _enddate = Convert.ToDateTime(dr["enddate"].ToString());
            }
        }

        /// <summary>
        /// ID
        /// </summary>
        [DataFieldAttribute("id", "pk")]
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }

        /// <summary>
        /// PID
        /// </summary>
        [DataFieldAttribute("Property_ID")]
        public int PropertyID
        {
            get { return _pid; }
            set { _pid = value; }
        }

        /// <summary>
        /// 名称
        /// </summary>
        [DataFieldAttribute("Name")]
        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                _name = value;
            }

        }

        [DataFieldAttribute("Week")]
        public string Week
        {
            get
            {
                return _week;
            }
            set
            {
                _week = value;
            }

        }

        [DataFieldAttribute("Description")]
        public string Description
        {
            get
            {
                return _desc;
            }
            set
            {
                _desc = value;
            }

        }


        [DataFieldAttribute("StartDate")]
        public DateTime StartDate
        {
            get { return _startdate; }
            set { _startdate = value; }
        }


        [DataFieldAttribute("EndDate")]
        public DateTime EndDate
        {
            get { return _enddate; }
            set { _enddate = value; }
        }
    }
}
